home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Setting Context
- Sent: 3/11/96 9:03 AM
- Received: 3/11/96 9:11 AM
- From: lamiraux@apple.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >Henri & team,
- >I have a part which is based on ODF Draw (d11). Within my content view,
- >I've embedded some subframes.
- >
- >I'm trying to understand the correct way to set the context so I can render
- >within these subframes. I've tried using FW_CViewContext,
- >FW_CFacetContext, and FW_CPlatformGraphicContext (individually, of course).
- >I want to set the context and then render within the frame using a mix of
- >ODF rendering methods and native calls. I would expect that after setting
- >the context, my rendering would be clipped to the subframe and all of my
- >rendering would also be relative to the subframe (nominally the topLeft
- >corner).
- >
- >Here's what I experienced using the above-listed contexts within the
- >subframe's draw methods:
- > FW_CViewContext
- > Native calls : rendering was relative to window's origin.
- > ODF : rendering was relative to contentview origin.
- > Clipping : clipped to frame, but if content view is scrolled,
- >overwrites scrollers & rulers.
- > FW_CFacetContext
- > Native calls : rendering was relative to window's origin.
- > ODF : rendering was relative to contentview origin
- > Clipping : didn't clip. If scrolled, ODF calls were offset as
- >expected, but native calls still were relative to window origin.
- > FW_CPlatformGraphicContext
- > Native calls : rendering was relative to contentview origin
- > ODF : rendering was relative to contentview origin
- > Clipping : clipped to frame, but if content view is scrolled,
- >overwrites scrollers & rulers.
- >
- >>From my experimentation it looks like FW_CPlatformGraphicContext is the
- >only case where ODF rendering and native rendering calls are in
- >registration with one another. However, even using
- >FW_CPlatformGraphicContext, I still have to clip out the rulers and
- >scrollers myself, and do a transformation to convert my coordinates from
- >frame coordinates to contentview-relative.
- >
- >Do I need to make another call to correctly set up the transform? I had
- >assumed these calls would set up the transform for me; either they don't,
- >or something's wrong with my subframe.
- >
- >I would appreciate any additional explanation which you feel would help me
- >better understand the relationship between these three calls, and the
- >context in which each should be used. (I've read both chapter 7 in the ODF
- >Developers Guide and the ODF View System document, provided with d11)
- >
- >Regards,
- >
- >Gary Ashcraft
- >ashcraft@itsnet.com
-
- FW_CViewContext and FW_CFacetContext (which is gone in our next release,
- FW_CViewContext replacing it) assume your are going to use the ODF
- Graphics. FW_CPlatformContext assumes your are going to use native calls.
- You cannot mix. FW_CPlatformContext just changes the grafport origin to
- reflect the facet position, it is very similar to CFocus from the OpenDoc
- utilities. FW_CViewContext leaves the origin to (0,0) and cache a
- transform to transform shapes so they can be drawn at the right place.
- Now, both of them should respect the clip set up by the containing frame.
- Unless we have a bug, you should not be allow to draw ontop of the rulers
- using FW_CPlatformContext. The clip of your embedded facets is set up by
- the container. The container doesn't know if its embedded facets are
- going to use a FW_CViewContext or a FW_CPlatformContext (I assume here
- that you (the container) is not trying to draw inside its embedded facets
- - this is illegal). Using a FW_CViewContext and ODF Graphic or a
- FW_CPlatformContext and Quickdraw should have the same result.
-